#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: 蒋艰坚
@file: 字段搜索.py
@time: 2021/7/29 17:18
@desc: 
"""
import os


def StringSearch(file_dir, string):
    destfile = []
    for files in os.listdir(file_dir):
        file_string = os.path.splitext(files)[0].split(sep=' ')
        for item in file_string:
            if string in item:
                destfile.append(files)

    print(destfile[0])
    return destfile


if __name__ == '__main__':
    dest = StringSearch('./picture', '5')
    print(dest[0])
